/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jpa.session;

import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import jpa.entities.EmpleadoCompetencia;
import jpa.entities.PerfilCompetencia;

/**
 *
 * @author Hassan
 */
@Stateless
public class PerfilCompetenciaFacade extends AbstractFacade<PerfilCompetencia> {
    @PersistenceContext(unitName = "bgx_rhPU")
    private EntityManager em;

    protected EntityManager getEntityManager() {
        return em;
    }

    public PerfilCompetenciaFacade() {
        super(PerfilCompetencia.class);
    }
    
     public List<PerfilCompetencia> getCompetenciasByPerfilId(int perfilId)
    {
        return em.createNamedQuery("PerfilCompetencia.findByPerfilId").setParameter("perfilId", perfilId).getResultList();
    }
}
